<template>
  <view class="success-page">
    <view class="success-content">
      <text class="success-title">预约成功</text>
      <text class="success-tip">您的练车预约已提交成功</text>
      
      <view class="reservation-info">
        <view class="info-item">
          <text class="info-label">预约编号：</text>
          <text class="info-value">DR20230001</text>
        </view>
        <view class="info-item">
          <text class="info-label">预约日期：</text>
          <text class="info-value">{{reservationData.date}}</text>
        </view>
        <view class="info-item">
          <text class="info-label">练车时段：</text>
          <text class="info-value">{{reservationData.time}}</text>
        </view>
        <view class="info-item">
          <text class="info-label">教练姓名：</text>
          <text class="info-value">{{reservationData.coach}}</text>
        </view>
        <view class="info-item">
          <text class="info-label">训练车辆：</text>
          <text class="info-value">{{reservationData.car}}</text>
        </view>
      </view>
      
      <button class="back-btn" @click="goBack">返回首页</button>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      reservationData: {
        id: 'DR20230001',
        date: '2023年6月15日 (周三)',
        time: '08:00 - 09:30',
        coach: '张教练',
        car: '大众捷达 (粤A·1234学)'
      }
    }
  },
  methods: {
    goBack() {
      uni.reLaunch({
        url: '/pages/index/index'
      })
    },
    viewDetail() {
      uni.navigateTo({
        url: '/pages/driving/reservationDetail?id=' + this.reservationData.id
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.success-page {
  display: flex;
  justify-content: center;
  align-items: center;
  
  .success-content {
    background-color: #fff;
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    
    .success-icon {
      width: 100px;
      height: 100px;
      margin-bottom: 20px;
    }
    
    .success-title {
      display: block;
      font-size: 24px;
      font-weight: bold;
      color: #333;
      margin-bottom: 10px;
    }
    
    .success-tip {
      display: block;
      font-size: 16px;
      color: #666;
      margin-bottom: 30px;
    }
    
    .reservation-info {
      background-color: #f9f9f9;
      border-radius: 12px;
      padding: 15px;
      text-align: left;
      
      .info-item {
        display: flex;
        margin-bottom: 10px;
        
        &:last-child {
          margin-bottom: 0;
        }
        
        .info-label {
          width: 90px;
          font-size: 14px;
          color: #666;
        }
        
        .info-value {
          flex: 1;
          font-size: 14px;
          font-weight: bold;
          color: #333;
        }
      }
    }
    
    button {
      height: 45px;
      line-height: 45px;
      border-radius: 25px;
      font-size: 16px;
      margin-bottom: 15px;
      
      &::after {
        border: none;
      }
    }
    
    .back-btn {
      background: linear-gradient(135deg, #ff80ab 0%, #ff4081 100%);
      color: #fff;
    }
    
    .detail-btn {
      background-color: #fff;
      color: #ff4081;
      border: 1px solid #ff4081;
    }
  }
}
</style>